package com.laomu.model;

import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotEmpty;

/**
 * 用户实体类
 * 
 * @ProjectName: [act-site]
 * @Package: [com.laomu.model.Users.java]
 * @ClassName: [Users]
 * @Description: [用来封装用户数据的实体类]
 * @Author: [老木]
 * @CreateDate: [2016年6月21日 下午1:54:35]
 * @UpdateUser: [老木]
 * @UpdateDate: [2016年6月21日 下午1:54:35]
 * @UpdateRemark: [说明本次修改内容]
 * @Version: [v1.0]
 */
public class User {

	private int userId;// 用户编号
	@Length(min = 6, max = 12)
	private String username;// 账号
	@Length(min = 6, max = 12)
	private String password;// 密码
	private String salt;// 盐值
	private int ecTimes;// 加密次数
	@NotEmpty
	private String nickname;// 昵称
	private boolean locked;// 是否锁定
	private String phone;// 联系方式
	@Email
	private String email;// 邮箱地址

	public User(String username, String password) {
		super();
		this.username = username;
		this.password = password;
	}

	public User(String username) {
		super();
		this.username = username;
	}

	public User() {
	}

	public int getUserId() {
		return userId;
	}

	public void setUserId(int userId) {
		this.userId = userId;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getSalt() {
		return salt;
	}

	public void setSalt(String salt) {
		this.salt = salt;
	}

	public int getEcTimes() {
		return ecTimes;
	}

	public void setEcTimes(int ecTimes) {
		this.ecTimes = ecTimes;
	}

	public String getNickname() {
		return nickname;
	}

	public void setNickname(String nickname) {
		this.nickname = nickname;
	}

	public boolean isLocked() {
		return locked;
	}

	public void setLocked(boolean locked) {
		this.locked = locked;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	@Override
	public String toString() {
		return "User [userId=" + userId + ", username=" + username + ", password=" + password + ", salt=" + salt
				+ ", ecTimes=" + ecTimes + ", nickname=" + nickname + ", locked=" + locked + ", phone=" + phone
				+ ", email=" + email + "]";
	}

}
